<!--
 * @Author: your name
 * @Date: 2022-01-03 18:37:00
 * @LastEditTime: 2022-02-06 17:40:17
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \vue\vue-douban-pc\src\views\adminMovies.vue
-->
<template>
    <div class="adminmovies">
        <el-col :span="4">
            <h1></h1>
        </el-col>
        <el-col :span="20">
            <el-table :data="table" style="width: 100%;" max-height="658">
                <el-table-column label="序列" type="index"></el-table-column>
                <el-table-column label="电影名" prop="tv_title"></el-table-column>
                <el-table-column label="演员" prop="tv_type"></el-table-column>
                <el-table-column align="right">
                    <template slot-scope="scope">
                        <el-button
                            size="mini"
                            type="danger"
                            @click="deleteMovie(scope.row)"
                        >删除</el-button>
                    </template>
                </el-table-column>
            </el-table>
        </el-col>
    </div>
</template>

<script>
export default {
    name: 'VueAdminmovies',

    data() {
        return {
            table: [],
            search: ''
        };
    },

    mounted() {

    },
    created() {
        this.getMovieList();
    },
    methods: {
        getMovieList() {
            this.axios.get("/getMovieList").then((res) => {
                this.table = res.data;
            })
        },
        deleteMovie(row) {
            this.axios.get("/deleteMovie", {
                params:{
                    id: row.tv_id
                }
            })
            this.$router.go(0)
        }
    },
};
</script>

<style lang="scss" scoped>
.adminmovies {
    position: relative;
    z-index: 10;
}
</style>